// Chopy string with out any inbuilt function.
// Date 22:57 12/10/2016
// By Ben a.k.a DreamVB

#include <iostream>

using namespace std;
using std::cout;
using std::endl;

int main(int argc, char *argv[]){
	
	char *s0 = "Example of copy char*s0 to char*s1 with out any built in function.\0";
	int size = strlen(s0);
	char *s1 = NULL;
	int i = 0;

	//Resize to hold string
	s1 = (char*)malloc(size);

	//Copy a char one at a time from s0 to s1
	while (i < size){
		//Copy over char
		s1[i] = s0[i];
		//INC counter
		i++;
	}
	//Make sure we add this tells us we hit the end of the string.
	s1[size] = '\0';
	//Print out s1
	cout << s1 << endl;

	system("pause");
	return 0;
}